package com.ruoyi.master.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.master.mapper.StrategyMapper;
import com.ruoyi.master.domain.Strategy;
import com.ruoyi.master.service.IStrategyService;

/**
 * 策略Service业务层处理
 * 
 * @author jiandan
 * @date 2024-10-23
 */
@Service
public class StrategyServiceImpl implements IStrategyService 
{
    @Autowired
    private StrategyMapper strategyMapper;

    /**
     * 查询策略
     * 
     * @param strategyId 策略主键
     * @return 策略
     */
    @Override
    public Strategy selectStrategyByStrategyId(Long strategyId)
    {
        return strategyMapper.selectStrategyByStrategyId(strategyId);
    }

    /**
     * 查询策略列表
     * 
     * @param strategy 策略
     * @return 策略
     */
    @Override
    public List<Strategy> selectStrategyList(Strategy strategy)
    {
        return strategyMapper.selectStrategyList(strategy);
    }

    /**
     * 新增策略
     * 
     * @param strategy 策略
     * @return 结果
     */
    @Override
    public int insertStrategy(Strategy strategy)
    {
        strategy.setCreateTime(DateUtils.getNowDate());
        return strategyMapper.insertStrategy(strategy);
    }

    /**
     * 修改策略
     * 
     * @param strategy 策略
     * @return 结果
     */
    @Override
    public int updateStrategy(Strategy strategy)
    {
        strategy.setUpdateTime(DateUtils.getNowDate());
        return strategyMapper.updateStrategy(strategy);
    }

    /**
     * 批量删除策略
     * 
     * @param strategyIds 需要删除的策略主键
     * @return 结果
     */
    @Override
    public int deleteStrategyByStrategyIds(Long[] strategyIds)
    {
        return strategyMapper.deleteStrategyByStrategyIds(strategyIds);
    }

    /**
     * 删除策略信息
     * 
     * @param strategyId 策略主键
     * @return 结果
     */
    @Override
    public int deleteStrategyByStrategyId(Long strategyId)
    {
        return strategyMapper.deleteStrategyByStrategyId(strategyId);
    }
}
